package com.ruoyi.ai.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 星火模型枚举
 */
public enum SparkModelEnum {
    LITE("spark-lite", "Spark Lite","https://spark-api.xf-yun.com/v1.1/chat","general"),
    SPARK2_0("spark-2.0", "Spark V2.0","https://spark-api.xf-yun.com/v2.1/chat","generalv2"),
    SPARK3_1("spark-3.1", "Spark Pro","https://spark-api.xf-yun.com/v3.1/chat","generalv3"),
    SPARK3_5("spark-3.5", "Spark3.5 Max","https://spark-api.xf-yun.com/v3.5/chat","generalv3.5"),
    SPARK4("spark-4.0","Spark4.0 Ultra","https://spark-api.xf-yun.com/v4.0/chat","4.0Ultra")
    ;

    @Getter
    private final String type;
    @Getter
    private final String desc;
    @Getter
    private final String host;
    @Getter
    private final String domain;

    SparkModelEnum(String type, String desc,String host,String domain) {
        this.type = type;
        this.desc = desc;
        this.host = host;
        this.domain = domain;
    }

    public static SparkModelEnum getByType(String type) {
        return Arrays.stream(values()).filter(c -> c.getType().equals(type)).findFirst().orElse(null);
    }
}
